密码保护 ZIP
密码保护 ZIP 文件涉及向归档文件中添加密码以保护其内容。 这样可以确保只有拥有正确密码的用户才能提取或访问 ZIP 压缩包中的文件。该密码起到加密作用,防止未经授权的用户访问压缩包中存储的文件。要从受密码保护的 ZIP 压缩包中提取文件,用户必须输入正确的密码。
准备开始了吗?
Nuget 下载 19,717 | 版本: 2026.4 刚刚发布
using IronZip;
using IronZip.Enum;
// Create empty ZIP with highest compression
using (var archive = new IronZipArchive(9))
{
// Password protect the ZIP (Support AES128 & AES256)
archive.Encrypt("P@ssw0rd", EncryptionMethods.Traditional);
archive.Add("./assets/image1.jpg");
archive.Add("./assets/image2.jpg");
// Export the ZIP
archive.SaveAs("output.zip");
}
Imports IronZip
Imports IronZip.Enum
' Create empty ZIP with highest compression
Using archive = New IronZipArchive(9)
' Password protect the ZIP (Support AES128 & AES256)
archive.Encrypt("P@ssw0rd", EncryptionMethods.Traditional)
archive.Add("./assets/image1.jpg")
archive.Add("./assets/image2.jpg")
' Export the ZIP
archive.SaveAs("output.zip")
End Using
Install-Package IronZip
密码保护 ZIP 文件涉及向归档文件中添加密码以保护其内容。 这样可以确保只有拥有正确密码的用户才能提取或访问 ZIP 压缩包中的文件。该密码起到加密作用,防止未经授权的用户访问压缩包中存储的文件。要从受密码保护的 ZIP 压缩包中提取文件,用户必须输入正确的密码。